<template>
  <div>
    <Chart :cdata="cdata" />
  </div>
</template>

<script>
  import Chart from './chart.vue';
  // import {merchantList,govAppealList} from '@/api/index'
  import {
    govAppealList
  } from '@/api/index'
  import handleGetData from '@/mixins/handleGetData'

  export default {
    mixins: [handleGetData],
    data() {
      return {
        cdata: {
          xData: [],
          seriesData: [

          ]
        },
        areaId:'',//区域id
      }
    },
    components: {
      Chart,
    },
    created() {
      this.areaId = localStorage.getItem('areaId')
      this.getData()
      this._handleData()
    },
    mounted() {},
    methods: {
      getData() {
        // merchantList().then((res) => {
        //   console.log('模块1数据',res)
        //   const data = res.result
        //   if(res.code == 200){
        //     this.cdata.seriesData = res.result
        //     res.result.forEach(item => {
        //       this.cdata.xData.push(item.name)
        //     });
        //   }
        // })
        let params = {
          areaId: this.areaId
        }
        govAppealList(params).then((res) => {
          console.log('模块1数据', res)
          // const data = res.result
          if (res.code == 200) {
            this.cdata.seriesData = res.result
            res.result.forEach(item => {
              this.cdata.xData.push(item.name)
            });
          }
        })
      },
    }
  }
</script>

<style lang="scss" scoped>
</style>